<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
        <head><title>trait SpecDasher in org.scalatest</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc (version 2.7.2.final)" name="generator"></meta><link href="../../style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="../../script.js"></script>
        </head>
        <body onload="init()">
        <table summary="" class="navigation">
        <tr>
          <td class="navigation-links" valign="top">
            <!-- <table><tr></tr></table> -->
          </td>
          <td align="right" valign="top" style="white-space:nowrap;" rowspan="2">
            <div class="doctitle-larger">ScalaTest 0.9.4</div>
          </td>
        </tr>
        <tr><td></td></tr>
      </table>
        
      <div class="entity">
        <a href="../../org/scalatest$package.html" target="_self">org.scalatest</a>
        <br></br>
        <span class="entity">trait  SpecDasher</span>
      </div><hr></hr>
      <div class="source">
        [source: <a href="" class="org/scalatest/SpecDasher"><code>org/scalatest/SpecDasher.scala</code></a>]
      </div><hr></hr>
      <a name="SpecDasher"></a><dl>
      <dt>
        @<a href="" target="contentFrame" class="scala/deprecated">scala.deprecated</a><br></br>
        <code></code>
        <code>trait</code>
        <em>SpecDasher</em>
      </dt>
      <dd><code> extends </code><a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html" target="_self">AnyRef</a></dd>
    </dl>
      <dl><dd>Trait that enables a more concise expression of <code>Spec</code> describers and examples by providing an
 implicit conversion that adds &#8220;dash methods&#8221; (<code>--</code> and <code>-</code>) to
 <code>String</code>. A string followed by a double dash (<code>--</code>) denotes a describer, and
 results at runtime in an invocation of <code>describe</code>. A string followed by a single
 dash (<code>-</code>) denotes an example, and results at runtime in an invocation of <code>it</code>.
 Here's an sample <code>Spec</code> written in &#8220;dashes&#8221; style:

 <pre>
 import org.scalatest.Spec
 import scala.collection.mutable.Stack

 class StackDashSpec extends Spec with SpecDasher {

   "A Stack" -- {

     "should pop values in last-in-first-out order" - {
       val stack = new Stack[Int]
       stack.push(1)
       stack.push(2)
       assert(stack.pop() === 2)
       assert(stack.pop() === 1)
     }

     "should throw NoSuchElementException if an empty stack is popped" - {
       val emptyStack = new Stack[String]
       intercept[NoSuchElementException] {
         emptyStack.pop()
       }
     }
   }
 }
 </pre>

 <p>
 Running <code>StackDashSpec</code> from within the Scala interpreter will yield:
 </p>

 <pre>
 scala> (new StackDashSpec).execute()
 </pre>

 <p>
 You would see:
 </p>

 <pre>
 A Stack
 - should pop values in last-in-first-out order
 - should throw NoSuchElementException if an empty stack is popped
 </pre>

 <p>
 <em>Note: This trait is deprecated and may be removed in a future release of ScalaTest. I included it in 0.9.4 so I could get
 informed feedback from users as to whether you think this should be included in the ScalaTest API. If
 it gets removed, then those who like this style of code can always just do this themselves, so it
 isn't that risky to use. But bear in mind it may go away.</em>
 </p></dd></dl>
      <dl><dt style="margin:10px 0 0 20px;">
        <b>Author</b></dt><dd>Bill Venners</dd></dl>
    <dl>
      <dt style="margin:10px 0 0 20px;"><b>Direct Known Subclasses:</b></dt>
      <dd><a href="../../org/scalatest/Spec.html" target="_self">Spec</a></dd>
      </dl><hr></hr>
      


<table summary="" cellpadding="3" class="member">
      <tr><td class="title" colspan="2">Method Summary</td></tr>
      <tr>
      <td class="modifiers" valign="top"> 
        <code>implicit def</code>
      </td>
      <td class="signature">
        <em><a href="../../org/scalatest/SpecDasher.html#stringToDasher%28String%29" target="_self">stringToDasher</a></em>
        (<em>s</em> : <a href="" target="contentFrame" class="java/lang/String">java.lang.String</a>) : <a href="../../org/scalatest/SpecDasher.Dasher.html" target="_self">Dasher</a>
        
        
      </td>
    </tr>
      </table><table summary="" cellpadding="3" class="inherited">
        <tr><td class="title" colspan="2">
          Methods inherited from <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html" target="_self">AnyRef</a>
        </td></tr>
        <tr><td class="signature" colspan="2">
          <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#getClass%28%29" target="_self">getClass</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#hashCode%28%29" target="_self">hashCode</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#equals%28Any%29" target="_self">equals</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#clone%28%29" target="_self">clone</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#toString%28%29" target="_self">toString</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#notify%28%29" target="_self">notify</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#notifyAll%28%29" target="_self">notifyAll</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#wait%28Long%29" target="_self">wait</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#wait%28Long%2CInt%29" target="_self">wait</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#wait%28%29" target="_self">wait</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#finalize%28%29" target="_self">finalize</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#%3D%3D%28AnyRef%29" target="_self">==</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#%21%3D%28AnyRef%29" target="_self">!=</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#eq%28AnyRef%29" target="_self">eq</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#ne%28AnyRef%29" target="_self">ne</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html#synchronized%28T0%29" target="_self">synchronized</a>
        </td></tr>
      </table><table summary="" cellpadding="3" class="inherited">
        <tr><td class="title" colspan="2">
          Methods inherited from <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html" target="_self">Any</a>
        </td></tr>
        <tr><td class="signature" colspan="2">
          <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#%3D%3D%28Any%29" target="_self">==</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#%21%3D%28Any%29" target="_self">!=</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#isInstanceOf" target="_self">isInstanceOf</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Any.html#asInstanceOf" target="_self">asInstanceOf</a>
        </td></tr>
      </table>
<table summary="" cellpadding="3" class="member">
      <tr><td class="title" colspan="2">Class Summary</td></tr>
      <tr>
      <td class="modifiers" valign="top"> 
        <code> class</code>
      </td>
      <td class="signature">
        <em><a href="../../org/scalatest/SpecDasher.Dasher.html" target="_self">Dasher</a></em>
        (<em>text</em> : <a href="" target="contentFrame" class="java/lang/String">java.lang.String</a>)<code> extends </code><a href="http://www.scala-lang.org/docu/files/api/scala/AnyRef.html" target="_self">AnyRef</a>
        
        <div>Class used via an implicit conversion to enable describers and examples in a <code>Spec</code>
   subclass to be specified by string followed by dashes, such as:
  
   <pre>
   "A Stack (when empty)" -- {
     "should not be full" - {
       assert(!stack.full)
     }
   }
   </pre></div>
      </td>
    </tr>
      </table>

      


<table summary="" cellpadding="3" class="member-detail">
          <tr><td class="title">Method Details</td></tr>
        </table><div><a name="stringToDasher%28String%29"></a><dl>
      <dt>
        
        <code>implicit</code>
        <code>def</code>
        <em>stringToDasher</em>(<em>s</em> : <a href="" target="contentFrame" class="java/lang/String">java.lang.String</a>) : <a href="../../org/scalatest/SpecDasher.Dasher.html" target="_self">Dasher</a>
      </dt>
      <dd></dd>
    </dl><hr></hr></div>


    <hr></hr>
        <div>Copyright (C) 2001-2008 Artima, Inc. All rights reserved.</div><table summary="" class="navigation">
        <tr>
          <td class="navigation-links" valign="top">
            <!-- <table><tr></tr></table> -->
          </td>
          <td align="right" valign="top" style="white-space:nowrap;" rowspan="2">
            <div class="doctitle-larger">ScalaTest 0.9.4</div>
          </td>
        </tr>
        <tr><td></td></tr>
      </table>
      </body>
      </html>